package Collection.Set;

import java.util.HashSet;
import java.util.Set;

public class SetDemo {
    public static void main(String[] args) {
        /*
         * 求一个字符串"aiodjl;hriWFUADJSVUEHiowfjnivowe"中一共有几个  不重复 的字母,区分大小写,如a,A算两个字符
         */
        String str = "aiodjl;hriWFUADJSVUEHiowfjnivowe";
        char[] chs = str.toCharArray();
        Set<Character> charSet= new HashSet<>();
        for(char ch : chs){
            if(( ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')){
                charSet.add(ch);
            }
        }
        System.out.println(chs.length);
        System.out.println(charSet);
    }
}
